package com.guigu.serviceorder.controller;

import com.guigu.serviceorder.entity.OrderItemLog;
import com.guigu.serviceorder.service.ITbOrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("center")
public class CenterOrderController {

    @Autowired
    private ITbOrderItemService orderItemService;

    /**
     * 我的订单
     * @param username
     * @return
     */
    @GetMapping("/orderItemLogList")
    public List<OrderItemLog> orderItemLogList(@RequestParam("username") String username){
        return this.orderItemService.OrderItemLogList(username);
    }

    /**
     * 查询我未付款的订单
     * @return
     */
    @GetMapping("orderPayList")
    public List<OrderItemLog> orderPayList(@RequestParam("username") String username){
        return this.orderItemService.orderPayList(username);
    }

    /**
     * 查询我未收货的订单
     * @param username
     * @return
     */
    @GetMapping("orderReceiveList")
    public List<OrderItemLog> orderReceiveList(@RequestParam("username") String username){
        return this.orderItemService.orderReceiveList(username);
    }

    /**
     * 查询我未收货的订单
     * @return
     */
    @GetMapping("centerOrderSend")
    public List<OrderItemLog> centerOrderSend(@RequestParam("username") String username){
        return this.orderItemService.centerOrderSend(username);
    }


    /**
     * 确认收货
     * @param orderId
     * @return
     */
    @GetMapping("updateconsignStatus")
    public void updateconsignStatus(@RequestParam("orderId") String orderId){
        this.orderItemService.updateconsignStatus(orderId);
    }

}
